﻿<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="Prototype._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <br />
    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource2">
    <ItemTemplate >
    <a href ="Default.aspx?tagname=<%# Eval("TagName")%>"> <%# Eval("TagName")%> |</a>
    </ItemTemplate>
    </asp:Repeater>
    <a href ="Default.aspx">Show All</a>
    <br />
    <br />
&nbsp;<asp:ImageButton ID="ImageButton1" runat="server" Height="50px" 
        ImageUrl="~/Images/Car Add.jpg" Width="70px" />
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
        AutoGenerateColumns="False" Width="750px">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="Details.aspx?ID={0}" DataTextField="cModel" 
                HeaderText="Model" SortExpression="ID">
            <ItemStyle ForeColor="#7F878F" HorizontalAlign="Center" 
                VerticalAlign="Middle" />
            </asp:HyperLinkField>
            <asp:BoundField DataField="cName" HeaderText="Type" SortExpression="cName">
            <ControlStyle Height="100px" Width="100px" />
            <ItemStyle ForeColor="#7F878F" Height="100px" HorizontalAlign="Center" 
                VerticalAlign="Middle" Width="100px" />
            </asp:BoundField>
            <asp:BoundField DataField="Engine" HeaderText="Engine" SortExpression="Engine">
            <ControlStyle Height="100px" BorderWidth="200px" Width="300px" />
            <ItemStyle ForeColor="#7F878F" Height="100px" HorizontalAlign="Center" 
                VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:BoundField DataField="Topspeed" HeaderText="Topspeed" 
                SortExpression="Topspeed">
            <ControlStyle Height="100px" Width="300px" />
            <ItemStyle ForeColor="#7F878F" Height="100px" HorizontalAlign="Center" 
                VerticalAlign="Middle" />
            </asp:BoundField>
            <asp:ImageField DataImageUrlField="cImage" HeaderText="Thumbnail">
                <ControlStyle Height="150px" Width="250px" />
                <ItemStyle Height="100px" Width="100px" />
            </asp:ImageField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [cModel], [cName], [Engine], [Topspeed], [cImage], [ID] FROM [cars]">
    </asp:SqlDataSource>
    <br />
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        
        
        SelectCommand="SELECT distinct [cModel], [cName], [Engine], [Topspeed], [cImage], [ID] FROM [cars Query] WHERE ([TagName] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="TagName" QueryStringField="tagname" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <br />
    
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT distinct [TagName] FROM [tag]"></asp:SqlDataSource>
    <br />
    <br />
&nbsp;
</asp:Content>
